package cn.com.headfree.callback.call;

import cn.com.headfree.base.controller.ResultData;
import cn.com.headfree.callback.back.CommRoleServerCallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * 调用公共组件获取角色信息
 */
@FeignClient(value = "comm-front-frame", fallback = CommRoleServerCallBack.class)
public interface CommRoleServerCall {

    /***
     * @description 根据角色ID获得角色下所有的人员信息
     * @author 冯亚
     * @date 2019年10月21日 下午4:48:38
     * @return ResultData
     */
    @RequestMapping(value = "/comm-front-frame/menu/findUserByLabelId/{labelId}/{domainId}", method = RequestMethod.GET)
    @ResponseBody
    public ResultData findUserByLabelId(@PathVariable("labelId") @RequestParam(required = true) String labelId, @PathVariable("domainId") @RequestParam(required = true) String domainId);

    /***
     * @description 根据用户ID和应用ID获取业务域
     * @author 冯亚
     * @date 2019年10月21日 下午4:48:38
     * @return ResultData
     */
    @RequestMapping(value = "/comm-front-frame/menu/findLabelByDomainId/{domainId}/{pageSize}/{pageNo}", method = RequestMethod.GET)
    @ResponseBody
    public ResultData findLabelByDomainId(@PathVariable("domainId") @RequestParam(required = true) String domainId,@PathVariable("pageSize") @RequestParam(required = true) int pageSize,@PathVariable("pageNo") @RequestParam(required = true) int pageNo);

    /**
	 * @description 根据登录用户的登录名获取用户所属的角色集合
	 * @author fengya
	 * @date 2020年7月4日 上午10:28:41
	 * @param loginName 对应登录用户的iscUserSourceId字段值
	 * @param domainId
	 * @return ResultData
	 */
    @RequestMapping(value = "/comm-front-frame/menu/findLabelByLoginName/{loginName}/{domainId}", method = RequestMethod.GET)
    @ResponseBody
    public ResultData findLabelByLoginName(@PathVariable("loginName") @RequestParam(required = true) String loginName,@PathVariable("domainId") @RequestParam(required = true) String domainId);

    /**
     * @description 根据登录用户的登录名获取用户所属的角色集合
     * @author fengya
     * @date 2020年7月4日 上午10:28:41
     * @return ResultData
     */
    @RequestMapping(value = "/comm-front-frame/menu/findUserByUserId/{userId}", method = RequestMethod.GET)
    @ResponseBody
    public ResultData findUserByUserId(@PathVariable("userId") @RequestParam(required = true) String userId);

    /**
     * @description 根据登录用户的登录名获取用户所属的角色集合
     * @author fengya
     * @date 2020年7月4日 上午10:28:41
     * @return ResultData
     */
    @RequestMapping(value = "/comm-front-frame/menu/findUserResourceByInterface/{resId}/{userId}/{code}", method = RequestMethod.GET)
    @ResponseBody
    public ResultData findUserResourceByInterface(@PathVariable("resId") @RequestParam(required = true) String resId,@PathVariable("userId") @RequestParam(required = true) String userId,@PathVariable("code") @RequestParam(required = true) String code);
}
